import request from '@/config/axios'

// CRM 企业配套用量信息 VO
export interface SupportingUsageVO {
  id: number // 编号
  customerId: number // 客户id
  bsType: number // 细分行业
  fillingDate: Date // 填报日期
  pureWater: number // 纯水用量
  tapWater: number // 自来水用量(不含打磨房)
  totalWater: number // 总用水量
  electricity: number // 总用电量
  steam: number // 蒸汽用量
  naturalGas: number // 天然气用量
  region: string // 区域
  auditStatus: number // 审批结果
  processInstanceId: string // 流程实例编号
}

// CRM 企业配套用量信息 API
export const SupportingUsageApi = {
  // 查询CRM 企业配套用量信息分页
  getSupportingUsagePage: async (params: any) => {
    return await request.get({ url: `/crm/supporting-usage/page`, params })
  },

  // 查询CRM 企业配套用量信息详情
  getSupportingUsage: async (id: number) => {
    return await request.get({ url: `/crm/supporting-usage/get?id=` + id })
  },

  // 新增CRM 企业配套用量信息
  createSupportingUsage: async (data: SupportingUsageVO) => {
    return await request.post({ url: `/crm/supporting-usage/create`, data })
  },

  // 修改CRM 企业配套用量信息
  updateSupportingUsage: async (data: SupportingUsageVO) => {
    return await request.put({ url: `/crm/supporting-usage/update`, data })
  },

  // 删除CRM 企业配套用量信息
  deleteSupportingUsage: async (id: number) => {
    return await request.delete({ url: `/crm/supporting-usage/delete?id=` + id })
  },

  // 导出CRM 企业配套用量信息 Excel
  exportSupportingUsage: async (params) => {
    return await request.download({ url: `/crm/supporting-usage/export-excel`, params })
  },

  // 下载企业配套用量信息导入模板
  importSupportingUsageTemplate: async () => {
    return await request.download({ url: `/crm/supporting-usage/get-import-template`})
  },
}
